<template>
	<view class="page-body bg-white" title-color="#333333" :class="[app.setCStyle()]">
		<u-navbar back-text="" :title-bold="true" title="确定支付"></u-navbar>
		<view class="top-box">
			<view class="price_box ff "><text class="price ">￥{{paySetting.balance_deduction}}</text></view>

		</view>
		<scroll-view class="scroll_view" scroll-y>
			<payBox :payType="payType" :from="from" :order_id="order_id" :paySetting="paySetting"></payBox>
			<view style="height: 50rpx;"></view>
		</scroll-view>
	</view>
</template>

<script>
	import payBox from '@/pagesB/channel/bond/payMent';
	export default {
		components: {
			payBox
		},
		data() {
			return {
				from: 'shop',
				payType: 'order', //支付类型
				order_id: 0,
				headerPosition: "fixed",
				headerTop: "0px",
				paySetting: {},
				type:''
			}
		},
		onLoad(options) {
			
			if (options.order_id < 1) {
				uni.showModal({
					title: '提示',
					content: 'ID传值错误.',
					showCancel: false,
					success: function(res) {
						if (res.confirm) {
							uni.switchTab({
								url: '/pages/center/index'
							});
						}
					}
				});
				return false;
			}
			this.order_id = parseInt(options.order_id);
			this.type = parseInt(options.type);
			uni.setNavigationBarTitle({
				title: '商城订单支付'
			})
			this.getOrder(options);
		},
		computed: {},
		onReady() {},
		methods: {
			getOrder(options) { //获取订单信息
				let order_id = this.order_id;
				let platform = this.app.getPlatform();
				this.$u.post('channel/api.bond/getPayOrder', {
					order_id: order_id,
					platform: platform,
					type: this.type
				}).then(res => {
					
					this.paySetting = res.data;
				}).catch(res => {
						
					// setTimeout(() => {
					// 	uni.redirectTo({
					// 		url: '/pages/shop/order/info?order_id=' + order_id
					// 	});
					// }, 1000);
				})
			}
		}
	}
</script>

<style lang="scss">
	::v-deep .u-navbar {
		color: #333333;
		background-color: #F3F3F3 !important;

	}

	::v-deep uni-page-body {
		background-color: #F3F3F3 !important;

	}

	::v-deep .u-border-bottom:after {
		border-bottom-width: 0px
	}

	.border-raduis {
		border-radius: 20rpx;
	}

	.top-box {
		background-color: #F3F3F3;
		text-align: center;
		padding: 60rpx;
		width: 100%;
		z-index: 1;
		z-index: 99;
		font-weight: 500;

		.price_box {
			font-size: 40rpx;

			.price {
				margin-left: 5rpx;
				font-size: 66rpx;
			}
		}
	}

	.scroll_view {
		height: calc(100% - 420rpx);
	}
</style>
